
<!DOCTYPE html>
<html>
<head  th:include="/shares/_Layout::commonHead('注册')">
    <meta charset="utf-8">  
    <title>阶梯算法</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <script th:src="@{/js/jq/jquery-1.8.0.min.js}" >
    </script>
    <link th:href="@{/js/jquery-validate/validation.css}" rel="stylesheet" />
    <script th:src="@{/js/jquery-validate/jquery.validate.js}" >
    </script>
    <link th:href="@{/css/pfCss.css}" rel="stylesheet" />
    <script th:src="@{/js/pfUtil.js}" >
    </script>
    <script type="text/javascript">
    $(document).ready(function () {

        var showMonthDialog=[[${price}]];
		alert(showMonthDialog);
    	
    	
			var f1=$("#f1");
			var priceF=$('#priceTbx');
			var volF=$('#volTbx');
			var resultSpan=$('#idResultSpan');
			var constantEdit=$('#constantEdit');
            f1.validate({
                errorClass: "error",
                onkeyup: false,
                submitHandler: function (form) {
                    var param = f1.serializeArray();
                    // var price=priceF.val().split(',');
					// var vol=volF.val().split(',');
					// param.push({name:'price',value:price});
					// param.push({name:'vol',value:vol});
                    $pf.post('/transferday/transfer',param,function(data){
						if(data.Result){
							resultSpan.html(data.Data);
						}
					}).error(function(data){
						resultSpan.html("参数错误");
						alert(data.responseText||"参数错误");
					});

                },
                rules: {
                    conn: {required: true}
,                    dst: {required: true}

                },
                messages: {
                    conn: {required: "必填"}
,                    dst: {required: "必填"}

                }
            });

            f1.find('.query-btn').click(function () {
                f1.submit();
            });
            f1.find('.reset-btn').click(function () {
                $pf.resetForm(f1);        
                $pf.resetForm(f2);   
					priceF.attr('ReadOnly','ReadOnly');
					volF.attr('ReadOnly','ReadOnly');
					constantEdit.val("修改");
			});
			
			constantEdit.click(function(){
				var me=constantEdit;
				if(me.val()==="修改"){
					priceF.removeAttr('ReadOnly');
					volF.removeAttr('ReadOnly');
					me.val("不修改");
				}else{
					priceF.attr('ReadOnly','ReadOnly');
					volF.attr('ReadOnly','ReadOnly');
					me.val("修改");
				}
			});

    	//$('#pResult');
    });
    </script>
</head>
<body>
<b>
[阶梯算法常量]<input id="constantEdit" type="button" value="修改" /><br />
</b>
<form name="f2" id="f2" action="#" method="post">
price:[<input id="priceTbx" type="text"  value="0, 0.06, 0.09, 0.12" ReadOnly="ReadOnly" />]<br />
vol:[<input id="volTbx" type="text"  value="500, 9000, 18000" ReadOnly="ReadOnly" />]<br />
</form>
<hr />
<b>
[输入变量]<br />
</b>
            <form name="f1" id="f1" action="#" method="post">
                <div class="search-box clearfix">             
                    <div class="kv-item clearfix">
                        <label for="">选择连接：</label>
                        <div class="kv-item-content ">
							<input type="number" name="connName" value="280" />
                        </div>
                    </div>
                    <div class="kv-item clearfix">
                        <label for="">测试导入到：</label>
                        <div class="kv-item-content ">
							<input type="text" name="dstTable" value="us_personal_info" />
                        </div>
                    </div>      


                    <div class="buttons">
                        <a href="javascript:;" class="sapar-btn sapar-btn-recom query-btn">查询</a>
                        <a href="javascript:;" class="sapar-btn sapar-btn-recom reset-btn">重置</a>
                    </div>
                </div>
            </form>
<hr />
<p class="resultP">
结果:<span id="idResultSpan"></span>
</p>
</body>
</html>